package com.mall.shopping.converter;

import com.mall.shopping.dal.entitys.Item;
import com.mall.shopping.dto.ProductDto;
import com.mall.shopping.dto.ProductDtoByHdf;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;

import java.util.List;

/**
 * @author: hdf
 * @class: ProductConverterByHdf
 */

@Mapper(componentModel = "spring")
public interface ProductConverterByHdf {

    @Mappings({
            @Mapping(source = "id",target = "productId"),
            @Mapping(source = "title",target = "productName"),
            @Mapping(source = "price",target = "salePrice"),
            @Mapping(source = "limitNum",target = "limitNum"),
            @Mapping(source = "image",target = "productImg")
    })
    ProductDtoByHdf items2Dto(Item items);

}
